home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGBLER
/
ASMCODE.LZH
/
RESPOND.ASM
< prev
next >
Wrap
Assembly Source File
|
1984-05-30
|
2KB
|
43 lines
PAGE,132
TITLE RESPONSE.ASM -- PROGRAM FOR BEEP REPSONSE AFTER <ENTER>
NAME RESPONSE_CODE
;
;
; PROGRAM REQUIRES NO PARMS: GENERATES A 3590 HZ BEEP, FOR 1 CLOCK
; ON CYCLE. THEN PERFORMS A FAR RETURN TO PASCAL OR CALLER.
;
;
RESPONSE_CODE SEGMENT PARA PUBLIC 'CODE'
ASSUME CS:RESPONSE_CODE
PUBLIC BEEP
BEEP PROC FAR ;ALL LINKED ROUTINES ARE FAR
PUSH BP ;SAVE THE BASE POINTER
MOV BP,SP ;GET THE CURRENT STACK POINTER
MOV BX,05 ;DURATION IN HUNDREDTHS OF SECONDS
MOV DI,3590 ;FREQUENCY IN HZ
MOV AL,0B6H ;WRITE TIMER MODE REGISTER
OUT 43H,AL ;LOAD THE TIMER PORT (43HEX)
MOV DX,14H ;
MOV AX,4F38H ;13310000/FREQUENCY TIMER DIVISOR
DIV DI ;SEE IF TIMER READY
OUT 42H,AL ;TIME UP, TURN OFF SPEAKER
MOV AL,AH ;GET THE HIGH BYTES AND WRITE THE QUITE TIME
OUT 42H,AL ;WRITE THE HIGH BYTE
IN AL,61H ;GET CURRENT PORT B SETTING
MOV AH,AL ;AND MOVE IT TO AH
OR AL,03 ;TURN LAST 2 BITS ON - SET SPKR ON
OUT 61H,AL ;
WAIT:
MOV CX,2801 ;KILL 10 MILLISECS
SPKR_ON:
LOOP SPKR_ON ;SEE IF TIME EXPIRED?
DEC BX ;IF NOT, KEEP SPEAKER ON
JNZ WAIT ;CONTINUE THE SOUND
MOV AL,AH ;PORT VALUE RECOVER
OUT 61H,AL ;RESTORED TO OLD SETTING (OFF)
POP BP ;GET OLD BASE POSITION
RET FAR ;FAR RETURN TO PASCAL
BEEP ENDP
RESPONSE_CODE ENDS
END